import { ApiPropertyOptional } from '@nestjs/swagger';
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

@Entity('user')
export class UserEntity {

  @PrimaryGeneratedColumn()
  id: string;


  @ApiPropertyOptional({ description: '用户姓名' })
  @Column({
    type: 'varchar',
    nullable: false,
    length: 128,
    name: 'firstName',
    comment: '用户姓名',
  })
  firstName: string;

  @Column({
    type: 'varchar',
    nullable: false,
    length: 128,
    name: 'lastName',
    comment: '用户名字',
  })
  lastName: string;

  @Column({
    type: 'boolean',
    nullable: false,
    length: 0,
    name: 'isActive',
    comment: '是否激活',
  })
  isActive: boolean;


  @ApiPropertyOptional({ description: '用户名称' })
  @Column({
    type: 'varchar',
    nullable: false,
    length: 128,
    name: 'userName',
    comment: '用户名称',
  })
  userName: string;

  @ApiPropertyOptional({ description: '登录密码' })

  @Column({
    type: 'varchar',
    nullable: true,
    length: 128,
    name: 'userPassword',
    comment: '登录密码',
  })
  userPassword?: string;

}
